package cn.ljy.quicksnip.model;

import cn.ljy.common.model.BaseModel;
import cn.ljy.common.model.validate.AddWorkValidation;
import cn.ljy.common.model.validate.UpdateWorkValidation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;

@ApiModel(value = "时间快")
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false, of = {"id"})
public class QsTimeBlock extends BaseModel {

    @ApiModelProperty(value = "时间块ID", example = "1")
    @NotNull(groups = UpdateWorkValidation.class, message = "时间块ID不能为空")
    private Long id;

    @ApiModelProperty(value = "时间快名称", required = true, example = "上午")
    @NotBlank(groups = AddWorkValidation.class, message = "时间块名称名称不能为空")
    @Size(min = 1, max = 30, message = "时间块名称长度必须在 {min} - {max} 之间")
    private String name;


    public QsTimeBlock(Long id) {
        this.id = id;
    }
}

